package com.ichart.html;

public class Theme {
	private String[] css = new String[0];
	private String[] js = new String[0];
	private String[] meta = new String[0];
	private String theme = "";
	private boolean dotheme = false;
	public static String enter = "\n";
	
	public String toString() {
		if(!dotheme){
			doTheme();
			dotheme = true;
		}
		return theme;
	}

	public void doTheme(){
		StringBuffer theme = new StringBuffer();
		
		for (String m : meta) {
			theme.append("<meta ");
			theme.append(m);
			theme.append("/>");
			theme.append(enter);
		}
		
		for (String c : css) {
			theme.append("<link rel=\"stylesheet\" href=\"");
			theme.append(c);
			theme.append("\" type=\"text/css\"/>");
			theme.append(enter);
		}
		for (String j : js) {
			theme.append("<script type=\"text/javascript\" src=\"");
			theme.append(j);
			theme.append("\"></script>");
			theme.append(enter);
		}
		
		this.theme =  theme.toString();
	}
	
	public String[] getCss() {
		return css;
	}
	public void setCss(String[] css) {
		this.css = css;
	}
	public String[] getJs() {
		return js;
	}
	public void setJs(String[] js) {
		this.js = js;
	}

	public String[] getMeta() {
		return meta;
	}

	public void setMeta(String[] meta) {
		this.meta = meta;
	}
	
	
}
